package com.base.bean.aggregations;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 聚合桶对象
 *
 * @author yangzihe
 * @date 2022/1/26
 */
@Data
public class AggregationBucketPO {

    /**
     * 聚合Bucket的key名
     */
    private String key;

    /**
     * 聚合Bucket的文档数量
     */
    private Long docCount;

    /**
     * 文档总数量
     */
    private Long docTotal;
    /**
     * 子桶集合
     */
    private List<AggregationBucketPO> subBucketList;
    public AggregationBucketPO(){

    }

    public AggregationBucketPO(String key, Long docCount) {
        this.key = key;
        this.docCount = docCount;
    }

    public AggregationBucketPO(String key, Long docCount, Long docTotal) {
        this.key = key;
        this.docCount = docCount;
        this.docTotal = docTotal;
    }

    public AggregationBucketPO(String key, Long docCount, List<AggregationBucketPO> subBucketList) {
        this.key = key;
        this.docCount = docCount;
        this.subBucketList = subBucketList;
    }
}
